#include <iostream>
#include <algorithm>
#include <cstdio>
#include <array>
#define ll long long
using namespace std;
#ifdef ONLINE_JUDGE

#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
char buf[1 << 23], *p1 = buf, *p2 = buf, ubuf[1 << 23], *u = ubuf;

#endif
ll read() {
    ll p = 0, flg = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') flg = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        p = p * 10 + c - '0';
        c = getchar();
    }
    return p * flg;
}
void write(ll x) {
    if (x < 0) {
        x = -x;
        putchar('-');
    }
    if (x > 9) {
        write(x / 10);
    }
    putchar(x % 10 + '0');
}
bool _stmer;

ll calc(ll x) { return x * (x - 1) / 2 - ((x - 1) / 2 + 1) * ((x - 1) / 2) - (((x - 1) & 1) * x / 2); }

void solve() {
    ll n = read();
    ll l = 2, r = 2e9, ans = -1;
    while (l <= r) {
        ll mid = (l + r) >> 1;
        if (calc(mid) >= n) ans = mid, r = mid - 1;
        else l = mid + 1;
    }
    if (((calc(ans) - n) & 1) && !(ans & 1))
        ans++;
    write(ans), puts("");
}

bool _edmer;
int main() {
    cerr << (&_stmer - &_edmer) / 1024.0 / 1024.0 << "MB\n";
#ifndef cxqghzj
    freopen("tree.in", "r", stdin);
    freopen("tree.out", "w", stdout);
#endif
    int T = read();
    while (T--) solve();
    return 0;
}
